package com.itheima.object;

public class Test3 {
    public static void main(String[] args) {
        // 目标：理解多个变量指向同一个对象的问题。
        Student s1 = new Student();
        s1.name = "播妞";
        System.out.println(s1.name);

        // 把学生类型的变量s1赋值给学生类型的变量s2
        Student s2 = s1;
        s2.name = "播仔";

        System.out.println(s1.name);
        System.out.println(s2.name);

        s1 = null;
        s2 = null;
        System.out.println(s1.name);
    }
}
